package application.models;

// Generated 8-dic-2011 3.00.32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Modwineorders generated by hbm2java
 */
@Entity
@Table(name = "modwineorders", catalog = "wineshop")
public class Modwineorders implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	private Long orderId;
	private Modwineusers modwineusers;
	private Modwineitems modwineitems;
	private Modwineshippings modwineshippings;
	private Date orderDate;
	private short qta;

	public Modwineorders() {
	}

	public Modwineorders(Modwineusers modwineusers, Modwineitems modwineitems,
			Modwineshippings modwineshippings, Date orderDate, short qta) {
		this.modwineusers = modwineusers;
		this.modwineitems = modwineitems;
		this.modwineshippings = modwineshippings;
		this.orderDate = orderDate;
		this.qta = qta;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "order_id", unique = true, nullable = false)
	public Long getOrderId() {
		return this.orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public Modwineusers getModwineusers() {
		return this.modwineusers;
	}

	public void setModwineusers(Modwineusers modwineusers) {
		this.modwineusers = modwineusers;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "item_id", nullable = false)
	public Modwineitems getModwineitems() {
		return this.modwineitems;
	}

	public void setModwineitems(Modwineitems modwineitems) {
		this.modwineitems = modwineitems;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shipping_id", nullable = false)
	public Modwineshippings getModwineshippings() {
		return this.modwineshippings;
	}

	public void setModwineshippings(Modwineshippings modwineshippings) {
		this.modwineshippings = modwineshippings;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "orderDate", nullable = false, length = 10)
	public Date getOrderDate() {
		return this.orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	@Column(name = "qta", nullable = false)
	public short getQta() {
		return this.qta;
	}

	public void setQta(short qta) {
		this.qta = qta;
	}

}
